package com.droowa.model.dao;

import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;



import com.droowa.domain.RefundManagement;
@Repository
public class RefundManagementDAOMybatisImpl implements RefundManagementDAO{
	@Autowired
	private SqlSessionTemplate session;

	public int insertRefundManagement(RefundManagement refundManagement)throws SQLException {
		return session.insert(makeSqlId("insertRefundManagement"),refundManagement);
	}

	public int updateRefundManagement(RefundManagement refundManagement)throws SQLException {
		return session.update(makeSqlId("updateRefundManagement"), refundManagement);
	}

	public int deleteRefundManagement(String orderNumber) throws SQLException {
		return session.delete(makeSqlId("deleteRefundManagement"), orderNumber);
	}

	
	@Override
	public List<RefundManagement> selectRefundManagementByAll(HashMap map)throws SQLException {
		return session.selectList(makeSqlId("selectRefundManagementByAll"),map);
	}

	private String makeSqlId(String id){
		return "droowa.refundManagement."+id;
	}
}
